package com.xinyi.reactivemvvmkt.sources.repository.impl

import com.xinyi.reactivemvvmkt.model.NeteaseCommentModel
import com.xinyi.reactivemvvmkt.model.Resource
import com.xinyi.reactivemvvmkt.model.request.NeteaseCommentRequest
import com.xinyi.reactivemvvmkt.sources.remote.NeteaseApi
import com.xinyi.reactivemvvmkt.sources.repository.BaseRepository
import com.xinyi.reactivemvvmkt.sources.repository.MainRepository
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

/**
 * @author 杨耿雷
 * @date 2024/9/24 21:26
 * @description 主页数据仓库实现类
 */
class MainRepositoryImpl @Inject constructor(private val mNeteaseApi: NeteaseApi): BaseRepository(), MainRepository {

    override suspend fun getNeteaseComment(request: NeteaseCommentRequest): Flow<Resource<NeteaseCommentModel>> {
        return safeRemoteApiCall {
            mNeteaseApi.getNeteaseComment(request)
        }
    }
}